/*
https://leetcode-cn.com/problems/repeated-substring-pattern/solution/zhong-fu-de-zi-zi-fu-chuan-by-leetcode-solution/
 */
public class Solution459 {
    public boolean repeatedSubstringPattern(String s) {
        return s.concat(s).substring(1, s.length()*2 - 1).contains(s);
    }

    public static void main(String[] args) {
        System.out.println(new Solution459().repeatedSubstringPattern("abab"));
    }
}
